<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    li{
      width: 500px;
      height: 40px;
      background-color: #abcdef;
      margin-top: 40px;
    }
  </style>
</head>
<body>
 <div id="app">
   <ul>
    <li v-for="item in arr">
      {{ item }}
    </li>
  </ul>
  <hr>
  <ul>
    <li v-for="(item, index) in arr" @click='removeLi(index)'>
      {{ item }}
      =>
      {{ index }}
    </li>
  </ul>
  <hr>
  <ul>
    <li v-for="item in json">
      {{ item }}
    </li>
  </ul>
  <hr>
  <ul>
    <li v-for="(item,key,index) in json">
      {{ key }}
      =>
      {{ index }}
      =>
      {{ item }}
    </li>
  </ul>
 </div> 
</body>
<script src="./vue.js"></script>
<script>
  const vm = new Vue({
    el: '#app',
    data: {
      arr: [1,2,3,4],
      json: {
        name: '小蜜蜂',
        age: 16,
        gender: '男'
      }
    },
    methods: {
      removeLi(i){
        this.arr.splice(i, 1)
      }
    }
  })
</script>
</html>